﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Runda.CMS.Common.Utility;
using Runda.CMS.Order.Entity;
using Runda.CMS.Order.Repository;

namespace Runda.CMS.Portal.OrderManagement
{
    public partial class ShippingList : BasePage
    {
        private ShippingRepository shippingRepository = new ShippingRepository();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

            }
        }

        private void BindList(int pageindex)
        {         
            int recordCount = 0;
            var list = shippingRepository.findShippingsByShippingId(txtShippingNum.Text.Trim(), AspNetPager1.PageSize, pageindex, out recordCount);
            RepeaterShippings.DataSource = list;
            RepeaterShippings.DataBind();
            AspNetPager1.RecordCount = recordCount;
        }

        protected void RepeaterShippings_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.CommandName == "refersh")
            {
                BindList(1);
            }
            if (e.CommandName == "delete")
            {

            }
        }
        protected void lnkbtnDelete_Click(object sender, EventArgs e)
        {

        }

        protected void AspNetPager1_PageChanged(object sender, EventArgs e)
        {
            BindList(AspNetPager1.CurrentPageIndex);
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            BindList(1);
        }

        protected void RepeaterShippings_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            
        } 
    }
}
